using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;

namespace Samples.Controllers
{
	public class TextBoxWatermarkController: Controller
	{
		//
		// GET: /TextBoxWatermark/

		public ActionResult Index()
		{
			GreetingsText(null, null);
			return View();
		}

		public ActionResult GreetingsText(string firstName, string lastName)
		{
			SetGreetingsText(firstName, lastName);
			return PartialView();
		}

		private void SetGreetingsText(string firstName, string lastName)
		{
			ViewData["GreetingsText"] = string.Format("Hello {0} {1}!",
				 string.IsNullOrEmpty(firstName) ? "[blank]" : firstName,
				 string.IsNullOrEmpty(lastName) ? "[blank]" : lastName);
		}
	}
}
